package com.bjsxt.controller;

import com.bjsxt.commons.pojo.BaizhanResult;
import com.bjsxt.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author coder_z
 * @date 2023/2/7
 * 商品分类接口
 **/
@RestController
@RequestMapping("/backend/itemCategory")
public class ItemCatController {
    @Autowired
    private ItemCatService itemCatService;
    /**
     * 根据父类目查询所有子类目 设置默认值为0 第一次查询时没有分类 想要查询第一次分类 父id为0
     * @param id
     * @return
     */
    @PostMapping("/selectItemCategoryByParentId")
    public BaizhanResult show(@RequestParam(defaultValue = "0") long id){
      return itemCatService.selectByParentId(id);
    }



}
